<?php
namespace Home\Controller;
use Todo\Controller\SpaceController;

class RateController extends SpaceController {

    public function users(){
        $id = I('get.id/d');
        if(!$id) $this->error("非法请求，请选择项目！");

        $list = D('Todo/Rate/User')->where(array('project_id'=>$id,'type'=>'1'))->select();
        if(!$list) $this->error("没有被评对象，暂时无法评分!");

        $this->assign('list', $list);
        $this->assign('projectId', $id);

        $userId =  I('get.user/d');
        if(!$userId) $userId = $list[0]['user_id'];
        $this->assign('userId', $userId);
                
        $this->display();
    }
    
    public function index(){
        $this->display();
    }
}